package com.dcw.lixb.designmode.strategy;

/**
 * @author lixiaobin
 * @date 2020-07-29 15:51:17
 * @desc 描述信息
 */
public class Context {
    private Strategy mStrategy;

    public void setStrategy(Strategy strategy) {
        mStrategy = strategy;
    }

    public int executeStrategy(int num1, int num2) {
        if (null != mStrategy) {
            return mStrategy.doOperation(num1, num2);
        }
        return new OperationAdd().doOperation(num1, num2);
    }
}
